/**
 ******************************************************************************
 * @file           : main.c
 * @brief          : USART Printf Example
 ******************************************************************************
 */

#include "stm32f4xx.h"
#include "./BSP/USART/bsp_usart.h"
#include <stdio.h>

int main(void)
{
    HAL_Init();
    SystemClock_Config();

    usart_init(115200);

    printf("STM32F4xx USART Printf Example\r\n");
    printf("System Clock: 168MHz\r\n");

    uint32_t count = 0;

    while (1)
    {
        printf("Count: %u\r\n", count++);
        HAL_Delay(1000);
    }
}

int fputc(int ch, FILE *f)
{
    usart_send_byte((uint8_t)ch);
    return ch;
}

void SystemClock_Config(void)
{
    /* 同01_GPIO_LED */
}
